package com.sky.controller.admin;

import com.sky.dto.OrdersPageQueryDTO;
import com.sky.result.PageResult;
import com.sky.result.Result;
import com.sky.service.OrdersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 邓必宏
 * @title:
 * @Demo:
 * @DateTime: 2024/2/13
 */

@RestController
@RequestMapping("/admin/order")
@Slf4j
@Api(tags = "订单相关接口")
public class OrdersController {
    
    @Autowired
    OrdersService ordersService;
    

    /**
     * 根据状态查询订单
     * */
    @GetMapping("/conditionSearch")
    @ApiOperation("订单分页查询")
    public Result<PageResult> conditionSearch(OrdersPageQueryDTO ordersPageQueryDTO){
        PageResult result= ordersService.getOrdersBy(ordersPageQueryDTO);
        log.info("订单分页查询，参数为{}", ordersService);
        log.info ( "订单分页查询结果为,{}",result );
        return Result.success(result);
    }

}
